package com.hbpu.encap.list;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ListExercise {
    public static void main(String[] args) {
        List list = new ArrayList();

        list.add("hello");
        list.add("world");
        list.add("haah");
        list.add("haha");
        list.add("steam");
        list.add("no");
        list.add("heihei");

        list.add(1, "韩顺平教育");
        list.get(4);
        list.remove(5);
        list.set(6, "修改");

        Iterator iterator = list.iterator();

        while (iterator.hasNext()) {
            Object next = iterator.next();
            System.out.println(next);
        }
    }
}


